<%@ page language="java" contentType="text/html; charset=UTF-8"
   pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript">
   $(document)
         .ready(
               function() {
                  var type = "";

                  $("#delImg")
                        .click(
                              function() {
                                 type = "delete";
                                 if (confirm(type + " 하시겠습니까?") != false) {
                                    location.href = "${initParam.root}notice/deleteBoard.do?no=${requestScope.nvo.no}&imagePath=${requestScope.nvo.imagePath}";

                                 }
                              });
                  $("#updateImg")
                        .click(
                              function() {
                                 type = "update";
                                 if (confirm(type + " 하시겠습니까?") != false) {
                                    location.href = "${initParam.root}notice/updateView.do?no=${requestScope.nvo.no }&imagePath=${requestScope.nvo.imagePath}";
                                 }
                                 return;
                              });
               });//ready
</script>
<h3>공지사항 - 상세정보</h3>
<hr align="left" width="150">
<center>
   <table class="content">
      <tr>
         <td><b>${requestScope.nvo.no }-${requestScope.nvo.title}</b></td>
      </tr>
      <tr>
         <td><font size="2">닉네임: ${requestScope.nvo.adminVO.nick }
               | 조회수: ${requestScope.nvo.hit } | ${requestScope.nvo.date}</font></td>
      </tr>
      <tr>
         <td>
            <img src="${initParam.root}/upload/notice/${requestScope.nvo.imagePath}" width="100" height="100">
      </tr>
      <tr>
         <td align="center"><textarea cols="70" rows="10" name="content"
               readonly="readonly">${requestScope.nvo.content }</textarea></td>
      </tr>
      <tr>
         <c:choose>
            <c:when test="${sessionScope.avo!=null}">
               <td valign="middle" align="center"><a href="list.do"><img
                     src="${initParam.root}/img/list_btn.jpg"></a> <img
                  id="updateImg" src="${initParam.root}/img/modify_btn.jpg"> <img
                  id="delImg" src="${initParam.root}/img/delete_btn.jpg"></td>
            </c:when>
            <c:otherwise>
               <td align="center"><a href="list.do"><img
                     src="${initParam.root}/img/list_btn.jpg"></a></td>
            </c:otherwise>
         </c:choose>
      </tr>
   </table>
</center>
<form action="${initParam.root }notice/deleteBoard.do">
   <input type="hidden" name="imagePath"
      value="${requestScope.nvo.imagePath}">
</form>
<form action="${initParam.root }notice/updateView.do">
   <input type="hidden" name="imagePath"
      value="${requestScope.nvo.imagePath}">
</form>